<?php
/**
 * Created by tools
 * user: alan.yue
 * Date：2021-03-01
 * Time: 15:59
 */

namespace app\admin\controller;

use app\admin\model\System;
use think\Controller;

class Base extends Controller
{
    public $page_init = [];

    public function initialize()
    {
        if (!session('username')) {
            $this->redirect('/admin/login');
        }
        $system = System::get(1);
        session('sys', $system);

        $this->page_init = [
            'M' => request()->module(),
            'C' => request()->controller(),
            'A' => request()->action(),
            'R' => '/' . request()->module() . '/' . request()->controller()
        ];
        $this->assign('page', $this->page_init);
    }
}